import request from '../utils/request'
import {ApiConf,httpConf} from '../utils/commonUtil'
import {EntityConf} from "../utils/entity";

const vo={
  blogUid: null,
  title: null,
  summary: null,
  content: null,
  tag_uid: null,
  click_count: null,
  collect_count: null,
  file_uid: null,
  status: 1,
  is_original: "1",
  author: null,
  articles_part: null,
  blog_sort_uid: null,
  is_publist: "1",
  sort: 1,
  outside_link: null,
  userUid: null,
  article_source: 1,
  currentPage:1
}

export function getBlogByUserApi (currentPage) {
  return request({
    url: EntityConf.BLOG+'/user/'+currentPage,
    method: httpConf.GET,
  })
}

export function getBlogCountByUserApi () {
  return request({
    url: EntityConf.BLOG+'/userBlogCount',
    method: httpConf.GET,
  })
}

export function getHotBlogApi () {
  return request({
    url: EntityConf.BLOG+'/hot',
    method: httpConf.GET,
  })
}

//base CRUD
export function getBlogApi (blogUid) {
  return request({
    url: EntityConf.BLOG+'/'+blogUid,
    method: httpConf.GET,
  })
}

export function postBlogApi (body) {
  return request({
    url: EntityConf.BLOG+'/',
    method: httpConf.POST,
    data:body
  })
}

export function deleteBlogApi (blogUid) {
  return request({
    url: EntityConf.BLOG+'/'+blogUid,
    method: httpConf.DELETE,
  })
}

